﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace NJL.Web
{
    public partial class MoreAttractions : BasePageVisitor
    {
        NJL.BLL.NJL_ATTRACTION bllAttr = new BLL.NJL_ATTRACTION();
        NJL.BLL.NJL_NEWS bllNews = new BLL.NJL_NEWS();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                base.LoadPageSeoInformation("景点名胜");        
                DataSet ds;
                if (WEBSITE_FOCUS_CITY_CODE == "")
                {
                    ds = bllAttr.GetAllList("NJL_SYS_BASE_ID='" + WEBSITE_CODE + "'");

                    if (ds.Tables[0].Rows.Count > 10)
                    {
                        pager.InnerHtml = Royalsoft.Common.Pager.GetPageNum(ds, rptAttr, 10, null, "/jdms/tjjd/");
                    }
                    else
                    {
                        rptAttr.DataSource = ds;
                        rptAttr.DataBind();
                    }
                }
                else
                {
                    ds = bllAttr.GetAllList("AREA_CODE='" + WEBSITE_FOCUS_CITY_CODE + "'");
                    if (ds.Tables[0].Rows.Count > 10)
                    {
                        pager.InnerHtml = Royalsoft.Common.Pager.GetPageNum(ds, rptAttr, 10, null, "/" + WEBSITE_FOCUS_CITY_NAME_PINYIN + "/jdms/tjjd/");
                    }
                    else
                    {
                        rptAttr.DataSource = ds;
                        rptAttr.DataBind();
                    }
                }
                if (WEBSITE_FOCUS_CITY_CODE == "")
                {
                    ds = bllAttr.GetList(10, "NJL_SYS_BASE_ID='" + WEBSITE_CODE + "'", "VISIT_COUNT desc,CREATE_DATE_TIME desc");
                }
                else
                {
                    ds = bllAttr.GetList(10, "AREA_CODE='" + WEBSITE_FOCUS_CITY_CODE + "'", "VISIT_COUNT desc,CREATE_DATE_TIME desc");
                }
                rptHotAttr.DataSource = ds;
                rptHotAttr.DataBind();
                ds = bllNews.GetList(5, "NJL_SYS_BASE_ID='" + WEBSITE_CODE + "'", "CREATE_DATE_TIME desc");
                rptNews.DataSource = ds;
                rptNews.DataBind();

            }
        }
    }
}